REPLICATION INFORMATION FOR "IMMIGRATION POLITICS AND PARTISAN REALIGNMENT: CALIFORNIA, TEXAS, AND THE 1994 ELECTION"
by Jamie Monogan and Austin Doctor

The Dataverse page for this study contains several raw data files, as well as cleaned files ready for analysis. Additional data source information is reported in the appendix to the paper. 

All models were estimated in R 3.2.4. There are several R programs available:
* aggregator.R: This file, and all of the input data that goes into it, are only necessary for users who: (A) want to verify that we properly cleaned the data or (B) are interested in some quantity we did not produce in our clean data. Those who are strictly interested in reproducing our models can skip this step and rely on analysis.R.
* aggregatorWeighted.R: An alternate version of aggregator.R that uses the Field Poll’s survey weights.
* alternateMeasure.R: This file runs two alternate versions of the macropartisanship time series models using data that includes partisan leaners--one version that simply adds leaners to partisan tallies, and another that focuses strictly on GOP shares of public support. This file uses raw inputs of MacropartisanshipLeaners.csv, consumerSentiment.csv, presApprovalGallup.csv, controlVars.csv, umembargo_cumulative.sav, fieldQuarters.csv, and caPartyUpdatesLeaners.csv.
* analysis.R: This is the primary replication program and produces results for every table and figure reported in the main text of the article. All reported models are estimated in this file using the seven principal input data files named below.
* analysisWeighted.R: An alternate version of analysis.R that uses the weighted version of the Field Poll data. This calls the same data as analysis.R, except the three California time series files are replaced by their weighted versions: caTotalMacropartisanship.csv, caHispMacropartisanship.csv, and caWhiteMacropartisanship.csv.
* redBlueAnalysis.R: This file estimates the alternate difference-in-differences models reported in the appendix using the American National Election Study. In addition to the California v. Texas contrast, it draws a contrast between red and blue states. This calls the large file anes_timeseries_cdf.dta.

The seven principal data files called by analysis.R are as follows:
* ca1994exit.dta: Exit poll from the 1994 California election. Two variables are key: "race" (coded 1=white, 2=black, 3=hispanic, 4=asian, 5=other) and "governor" (coded 1=brown, 2=wilson, 8=other). The weight variable is named "weight".
* texas1994exit.dta: Exit poll from the 1994 Texas election. For these data, relevant categories are named as factors. (E.g., "BUSH" and "RICHARDS" are the options for governor.) The two key variables are: "V11" (measuring race) and "V15" (measuring choice for governor). The weight variable is named "V51".
* tx9098.csv: Quarterly data for Texas macropartisanship, 1990-1998. Reports Republican (txRep) and Democratic (txDem) percentages of all survey respondents, as well as macropartisanship (percent Democratic of those identifying with one major party--txMacro). Data are tabulated for all respondents, Hispanic respondents (variables: txHispRep, txHispDem, & txHispMacro), and white respondents (variables: txWhiteRep, txWhiteDem, txWhiteMacro). Data are indexed by year and quarter, and a "joint" index uniquely identifies each quarter-year.
* usMacropartisanship.csv: Quarterly data for United States macropartisanship, 1969-2010. Variables are: macropartisanship (macropartisanship.q), consumer sentiment (negative during GOP administrations, positive when Democratic--sentiment), presidential approval (negative during GOP administrations, positive when Democratic--approve.q), the political element of approval (residual from regression of approval as a function of sentiment--political), a presidential party indicator (-1=GOP, 1=Democrat--party), and a factor for presidential term (president). Copies of variables preceded with "l." are lagged by one quarter. Data are indexed by year and quarter, and an "id" that uniquely identifies each quarter-year.
* caTotalMacropartisanship.csv: Quarterly data for California macropartisanship among all Field Poll respondents (caPartisanship.q), 1969-2010. Also records national-level values of several variables coded in exactly the same way as in macropartisanship.csv: sentiment, approve.q, political, party, president, year, quarter, and id. Additionally, "l." denotes lagged values.
* caHispMacropartisanship.csv: Quarterly data for California macropartisanship among Hispanic Field Poll respondents (caPartisanship.hisp.q), 1969-2010. Also records national-level values of presidential approval, the political element of approval, consumer sentiment, a presidential party indicator, and a factor for presidential term. Several lagged variables are also reported.
* caWhiteMacropartisanship.csv: Quarterly data for California macropartisanship among white Field Poll respondents (caPartisanship.white.q), 1969-2010. Also records national-level values of presidential approval, the political element of approval, consumer sentiment, a presidential party indicator, and a factor for presidential term. Several lagged variables are also reported.

Other data files include:
* anes_timeseries_cdf.dta: Cumulative American National Election Study file.
* caTotalMacropartisanshipWeight.csv: Weighted version of quarterly data for California macropartisanship among all Field Poll respondents (caPartisanship.q), 1969-2010. Also records national-level values of several variables coded in exactly the same way as in macropartisanship.csv: sentiment, approve.q, political, party, president, year, quarter, and id. Additionally, "l." denotes lagged values.
* caHispMacropartisanshipWeight.csv: Weighted version of quarterly data for California macropartisanship among Hispanic Field Poll respondents (caPartisanship.hisp.q), 1969-2010. Also records national-level values of presidential approval, the political element of approval, consumer sentiment, a presidential party indicator, and a factor for presidential term. Several lagged variables are also reported.
* caWhiteMacropartisanshipWeight.csv: Weighted version of quarterly data for California macropartisanship among white Field Poll respondents (caPartisanship.white.q), 1969-2010. Also records national-level values of presidential approval, the political element of approval, consumer sentiment, a presidential party indicator, and a factor for presidential term. Several lagged variables are also reported.
* caPartyUpdates.csv: Raw unweighted data updating the California Field Poll beyond the cumulative file.
* caPartyUpdatesLeaners.csv: Alternate version of raw unweighted data updating the California Field Poll using party leaners.
* consumerSentiment.csv: University of Michigan Index of Consumer Sentiment by quarter, 1960-2014.
* controlVars.dta: Two additional control variables for time series models, percentage of the Hispanic population that is foreign born, and the number of Los Angeles Times stories about immigration.
* fieldQuarters.csv: Simple file that links year and quarter to the ID number of each Field Poll survey.
* macropartisanship.csv: Separate Gallup survey results for partisan identification, 1965-2012.
* MacropartisanshipLeaners.csv: Alternate Gallup survey results that include independent leaners in partisan identification, 1984-2010.
* presApprovalGallup.csv: Separate Gallup survey results for presidential approval, 1961-2012.
* texasPoll.zip: ZIP folder containing 37 Texas Poll files.
* unembargo_cumulative.sav: Field Poll Cumulative File, 1956-2008.
* WEIGHTED.UCDATA.csv: Raw survey-weighted data updating the California Field Poll beyond the cumulative file.
